import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const actions = {}
const mutations = {
  // handleUserName: (state, data) => {
  //   state.user_name = data
  //   // 把登录的用户的名保存到localStorage中，防止页面刷新，导致vuex重新启动，用户名就成为初始值（初始值为空）的情况
  //   window.sessionStorage.setItem('user_name', data)
  // },
  
}
const state = {
  // user_name: '' || window.sessionStorage.getItem('user_name'),
}
// getters 只会依赖 state 中的成员去更新
const getters = {
  // userName: (state) => state.user_name,
  // User: (state) => state.searchUser,
  // Company: (state) => state.searchCompany,
  // userType: (state) => state.user_type
}

const store = new Vuex.Store({
  actions,
  mutations,
  state,
  getters
})
export {
  store
}
